import request from '@/utils/request'

// 获取活动列表
export function getList(query) {
  return request({
    url: '/system/activity/list',
    method: 'get',
    params: query
  })
}

// 查询活动详情
export function activityDetailById(id) {
  return request({
    url: '/system/activity/' + id,
    method: 'get',
    loadIng: true
  })
}

// 获取客户列表
export function visitAuthActivityPageList(query) {
  return request({
    url: '/system/activity/visitAuth/pageList',
    method: 'get',
    params: query,
    loadIng: true
  })
}

// 设置所有员工访问该活动
export function allStaffVisit(id) {
  return request({
    url: '/system/activity/allStaffVisit/' + id,
    method: 'post',
    loadIng: true
  })
}

// 保存活动
export function saveActivity(data) {
  return request({
    url: '/system/activity',
    method: 'post',
    loading: true,
    data: data
  })
}

// 修改活动
export function editActivity(data) {
  return request({
    url: '/system/activity',
    method: 'put',
    loading: true,
    data: data
  })
}

// 活动列表（分页）
export function pageList(query) {
  return request({
    url: '/system/activity/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动详情统计
export function activityDetailStats(id) {
  return request({
    url: '/system/activity/detailStats/' + id,
    method: 'get',
    loadIng: true
  })
}

// 活动订单列表
export function activityOrderList(query) {
  return request({
    url: '/system/activity/orderInfo/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动拼团统计
export function teamSta(id) {
  return request({
    url: '/system/activity/teamSta/' + id,
    method: 'get',
    loadIng: true
  })
}

// 活动订单列表
export function orderList(query) {
  return request({
    url: '/system/activity/orderList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动订单拼团列表
export function activityOrderGroupPurchaseList(query) {
  return request({
    url: '/system/activity/orderGroupPurchase/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动退款列表
export function refundPageList(query) {
  return request({
    url: '/system/activity/refund/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动邀请奖励列表
export function inviteRewardList(query) {
  return request({
    url: '/system/activity/inviteReward/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}


// 活动邀请奖励列表
export function infoById(id) {
  return request({
    url: '/system/activity/detail/' + id,
    method: 'get',
    loading: true
  })
}

// 活动删除
export function delActivity(id) {
  return request({
    url: '/system/activity/' + id,
    method: 'delete',
    loading: true
  })
}

// 邀请奖励核销
export function inviteRewardVerification(data) {
  return request({
    url: '/system/activity/inviteReward/verification',
    method: 'post',
    data: data,
    loading: true
  })
}

// 获取活动草稿列表
export function getDraftDataList(query) {
  return request({
    url: '/system/activity/draft/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 查询可移动团列表
export function queryCanMoveTeamList(query) {
  return request({
    url: '/system/activity/canMoveTeam/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 活动分销统计
export function distributionStats(activityId) {
  return request({
    url: '/system/activity/distributionStats/' + activityId,
    method: 'get',
    loading: true
  })
}


// 获取分销记录列表
export function distributionRecordList(query) {
  return request({
    url: '/system/activity/distribution/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}


// 活动大屏数据
export function activityBigData(activityId) {
  return request({
    url: '/system/activity/bigData/' + activityId,
    method: 'get'
  })
}


// 活动分享短链接
export function subscribeToUrl(query) {
  return request({
    url: '/system/activity/subscribeToUrl/' + query,
    method: 'get',
    loading: true
  })
}


// 获取活动海报配置
export function activityPosterConfig(activityId) {
  return request({
    url: '/system/activity/posterConfig/' + activityId,
    method: 'get',
    loading: true
  })
}


// 修改活动
export function updatePosterConfig(data) {
  return request({
    url: '/system/activity/updatePosterConfig',
    method: 'post',
    loading: true,
    data: data
  })
}

// 管理后台获取模版海报图片
export function templatePosterImg(data) {
  return request({
    url: '/system/activity/getTemplatePoster',
    method: 'post',
    loading: true,
    data: data
  })
}

// 客户推广短链接
export function memberPublicizeUrl(memberId,activityId) {
  return request({
    url: '/system/activity/memberPublicizeUrl/' + memberId + '/' + activityId,
    method: 'get',
    loading: true
  })
}

// 客户海报图片
export function memberPosterImg(memberId,activityId) {
  return request({
    url: '/system/activity/memberPosterImg/' + memberId + '/' + activityId,
    method: 'get',
    loading: true
  })
}

// 获取活动列表
export function settlementPageList(query) {
  return request({
    url: '/system/activity/settlement/pageList',
    method: 'get',
    params: query
  })
}

// 获取清算明细
export function manualSettlement(activityId) {
  return request({
    url: '/system/activity/manualSettlement/' + activityId,
    method: 'get',
    loading: true
  })
}

// 申请清算
export function settlementApply(activityId) {
  return request({
    url: '/system/activity/settlement/apply/' + activityId,
    method: 'get',
    loading: true
  })
}

// 清算
export function settlement(activityId) {
  return request({
    url: '/system/activity/settlement/' + activityId,
    method: 'get',
    loading: true
  })
}

// 获取申请清算列表和同意清算列表
export function applySettlementPageList(query) {
  return request({
    url: '/system/activity/settlement/apply/pageList',
    method: 'get',
    params: query
  })
}
